/*
 * @Author: cest cestrmail@163.com
 * @Date: 2022-12-12 09:30:22
 * @LastEditors: cest cestrmail@163.com
 * @LastEditTime: 2022-12-12 16:54:34
 * @FilePath: /ithome-lite/src/utils/api.ts
 * @Description: 介绍文件的作用、文件的入参、出参。
 */
import request from './request'
import { platform } from './index'
const baseUrlApi = platform === 'h5' ? '/api' : 'https://api.ithome.com'

export const getNewsList = (r?: string) =>
  request.get('/json/newslist/news', null, {
    baseURL: baseUrlApi
  })

export const getNews = (id: string) =>
  request.get(`/xml/newscontent/${id}.xml`, null, {
    baseURL: baseUrlApi
  })

export const getSlides = () =>
  request.get('/xml/slide/slide.xml', null, {
    baseURL: baseUrlApi
  })
